package com.homegoods.designer.presenter;

import android.databinding.ObservableField;
import android.text.SpannableStringBuilder;

import com.homegoods.designer.model.CaseDetailModel;
import com.homegoods.designer.util.Utils;
import com.kedll.library.mvp.BasePresenter;
import com.kedll.library.mvp.BaseView;

/**
 * @author QiQi
 */
public class CaseDetailPresenter extends BasePresenter<BaseView> {
    private CaseDetailModel caseModel;
    public ObservableField<String> designerType = new ObservableField<>();

    public CaseDetailPresenter(BaseView view, CaseDetailModel caseModel) {
        super(view);
        this.caseModel = caseModel;
        designerType.set("设计师");
    }


    public String getImgUrl() {
        return caseModel.getCaseModel().getBgimg();
    }

    public String getTitle() {
        return caseModel.getCaseModel().getTitle();
    }

    public String getHeadUrl() {
        return caseModel.getHomeModel().getBgimg();
    }

    public String getHouseType() {
        return caseModel.getCaseModel().getHuxing();
    }

    public String getName() {
        return caseModel.getHomeModel().getName();
    }

    public String getArea() {
        return caseModel.getHomeModel().getCity();
    }

    public SpannableStringBuilder getSpace() {
        return Utils.getSpace(caseModel.getCaseModel().getMianji());
    }
}